import axios from '@/libs/axios1'
let jsonHeaders = { 'content-type': 'application/json;charset=UTF-8' }
let base = '/testplatform/productComponentVulnerability'

// 查询潜在漏洞列表
export const queryComponentVulnerabilityList = params => {
  return axios({
    url: `${base}`,
    method: 'GET',
    params,
    headers: jsonHeaders,
  })
}

// 将公共漏洞关联为潜在漏洞
export const addComponentVulnerability = data => {
  return axios({
    url: `${base}/add`,
    method: 'POST',
    data,
    headers: jsonHeaders,
  })
}

// 删除公共漏洞的关联关系
export const deleteComponentVulnerability = (componentId, vulnerabilityId) => {
  return axios({
    url: `${base}/delete/${componentId}/${vulnerabilityId}`,
    method: 'DELETE',
    headers: jsonHeaders,
  })
}